import time
import sys
import threading
TIMEFORMAT='%Y-%m-%d %X'
time.strftime(TIMEFORMAT,time.localtime())
'2016-01-25 18:43:53'
def func():
	print(time.strftime(TIMEFORMAT,time.localtime()))
	global t
	t=threading.Timer(0.5,func)
	t.start()

t=threading.Timer(1.0,func)
t.start()
	
